<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use DB;
use Illuminate\Http\Request;

class Message extends Model
{
    //
    protected $table = 'message';
    public $timestamps = false;
    protected $fillable = ['status'];

    public function addAll(Array $data)
  	{
	     $rs = DB::table($this->getTable())->insert($data);
	     return $rs;
  	}

  	public function messageText()
  	{
  		return $this->hasOne('App\Model\MessageText','id','message_id');
  	}
    public function frominfo(){
      return $this->belongsTo('App\Model\Users','from_id','id');
    }
    public function toinfo(){
      return $this->belongsTo('App\Model\Users','to_id','id');
    }
}
